//
//  WXLStypeIsTwoCollectionViewCell.m
//  段子手
//
//  Created by dllo on 16/3/20.
//  Copyright © 2016年 JokesTeam. All rights reserved.
//

#import "WXLStypeIsTwoCollectionViewCell.h"

@interface WXLStypeIsTwoCollectionViewCell ()

@property (nonatomic, retain) UIImageView *imgView; /**< 大图 */
@property (nonatomic, retain) UILabel *titleLabel; /**< 标题 */
@property (nonatomic, retain) UILabel *assistantLabel; /**< 副标题 */

@end

@implementation WXLStypeIsTwoCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
}

- (void)createSubView {
    self.imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.height, self.bounds.size.height)];
    [self addSubview:_imgView];
    
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(_imgView.frame.size.width + 10, (self.bounds.size.height / 3) / 2, self.bounds.size.width - _imgView.frame.size.width - 10, self.bounds.size.height / 3)];
    [self addSubview:_titleLabel];
    _titleLabel.font = [UIFont systemFontOfSize:18];
    
    self.assistantLabel = [[UILabel alloc] initWithFrame:CGRectMake(_titleLabel.frame.origin.x, _titleLabel.frame.size.height + _titleLabel.frame.origin.y, _titleLabel.frame.size.width, _titleLabel.frame.size.height)];
    [self addSubview:_assistantLabel];
    _assistantLabel.font = [UIFont systemFontOfSize:16];
    _assistantLabel.textColor = [UIColor colorWithWhite:0.355 alpha:1.000];
}

- (void)setModel:(WXLActionModel *)model {
    _model = model;
    
    [_imgView HANDLEIMAGE(model.picUrl)];
    _titleLabel.text = _model.name;
    _assistantLabel.text = _model.desc;
}

@end
